<?php

namespace app\admin\event;

class Info
{
    public function afterInsert($req)
    {
        if (session('adminId')) {
            $aid = session('adminId');
        } else {
            $aid = 0;
        }
        $data = [
            'aid' => $aid,
            'eid' => $req['id'],
            'msg' => '初次到来，多多指教【'.$req['title'].'】',
        ];
        model('admin/adminlog')->save($data);
    }

    public function afterUpdate($req)
    {
        if (session('adminId')) {
            $aid = session('adminId');
        } else {
            $aid = 0;
        }
        $data = [
            'aid' => $aid,
            'msg' => '更新了基本信息【'.$req['title'].'】',
        ];
        model('admin/adminlog')->save($data);
    }
}
